package com.itheima.apitest.datetest3;

import java.util.Arrays;

public class ExceptionDemo02 {
    public static void main(String[] args) {
        //int[] arr = {1,2,3,4};
        int[] arr = null;
        printArr(arr);
    }

    private static void printArr(int[] arr) {
        if(arr == null){
            System.out.println("参数不能为空");
            throw new NullPointerException();
        }else {
            String s = Arrays.toString(arr);
            System.out.println(s);
        }
    }
}
